#pragma once

#include <string>
#include <vector>
#include "db_handler.h"

namespace TakeAwayPlatform
{
    class OrderModule
    {
    public:
        OrderModule(DatabaseHandler& dbHandler);

        bool createOrder(int user_id, int merchant_id, int address_id, const std::vector<std::pair<int, int>>& cart_items, double total_amount);
        bool updateOrderStatus(int order_id, int status);
        bool getOrderDetails(int order_id, int& user_id, int& merchant_id, int& address_id, std::vector<std::pair<int, int>>& cart_items, double& total_amount, int& status);
        bool getOrdersByUser(int user_id, std::vector<int>& order_ids);

    private:
        DatabaseHandler& dbHandler;
    };
}
